<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css"
          integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous" />

    <!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap-theme.min.css"
          integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous" />

    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"
            integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous">
    </script>

    <title>TD巡检</title>
    <style>
        .table {
            background-color: bisque;
            border-collapse: collapse;
            border-width: 3px;
            border-style: solid;
            text-align: center;
            margin: 20px;
            /* 将padding 和 border 都算入宽高中 */
            box-sizing: border-box;
        }

        h1 {
            text-align: center;
        }
    </style>
</head>

<body>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="span12">
            <br>
            <h1>
                <span class=" badge-warning">Talkingdata 巡检报告</span>
            </h1>
            <br>
            <h3>hdfs 集群状态</h3>
            <br>
            <table class="table table-hover table-bordered">
                <thead>
                <tr>
                    <th>集群名称</th>
                    <th>活跃管理节点</th>
                    <th>总容量</th>
                    <th>使用率</th>
                    <th>文件数量</th>
                    <th>块数量</th>
                    <th>丢块数量</th>
                    <th>复制数据块</th>
                    <th>健康DataNode</th>
                    <th>故障DataNode</th>
                    <th>Hadoop 版本</th>
                </tr>
                </thead>
                <tbody>
                <tr th:each="hdfsState : ${hdfsStateList}">
                    <td th:text="${hdfsState.getServiceId()}"></td>
                    <td th:text="${hdfsState.getActiveNamenode()}"></td>
                    <td th:text="${hdfsState.getCapacityByteDesc()}"></td>
                    <td th:text="${hdfsState.getPercentUsed()}"></td>
                    <td th:text="${hdfsState.getTotalFiles()}"></td>
                    <td th:text="${hdfsState.getTotalBlocks()}"></td>
                    <td th:text="${hdfsState.getMissingBlocks()}"></td>
                    <td th:text="${hdfsState.getUnderReplicatedBlocks()}"></td>
                    <td th:text="${hdfsState.getNumLiveDatanodes()}"></td>
                    <td th:text="${hdfsState.getNumDeadDatanodes()}"></td>
                    <td th:text="${hdfsState.getVersion()}"></td>
                </tr>
                </tbody>
            </table>
            <hr>
            <h3>namenode 状态</h3>
            <hr>
            <table class="table table-hover table-bordered">
                <thead>
                <tr>
                    <th>集群名称</th>
                    <th>节点编号</th>
                    <th>主机名</th>
                    <th>服务状态</th>
                    <th>rpc 地址</th>
                    <th>http 地址</th>
                </tr>
                </thead>
                <tbody>
                <tr th:each="nn : ${nnlist}">
                    <td th:text="${nn.getServiceId()}"></td>
                    <td th:text="${nn.getNnId()}"></td>
                    <td th:text="${nn.getAddress()}"></td>
                    <td th:text="${nn.getServiceState()}"></td>
                    <td th:text="${nn.getRpcAddress()}"></td>
                    <td th:text="${nn.getHttpAddress()}"></td>
                </tr>
                </tbody>
            </table>
            <hr>
            <h3>yarn 集群状态</h3>
            <hr>
            <table class="table table-hover table-bordered">
                <thead>
                <tr>
                    <th>集群名称</th>
                    <th>健康节点</th>
                    <th>丢失节点</th>
                    <th>不健康节点</th>
                    <th>memory</th>
                    <th>vcore</th>
                    <th>Hadoop 版本</th>
                </tr>
                </thead>
                <tbody>
                <tr th:each="ysl : ${yarnStatusList}">
                    <td th:text="${ysl.getClusterId()}"></td>
                    <td th:text="${ysl.getActiveNodes()}"></td>
                    <td th:text="${ysl.getLostNodes()}"></td>
                    <td th:text="${ysl.getUnhealthyNodes()}"></td>
                    <td th:text="${ysl.getTotalByteDesc()}"></td>
                    <td th:text="${ysl.getTotalVirtualCores()}"></td>
                    <td th:text="${ysl.getVersion()}"></td>
                </tr>
                </tbody>
            </table>
            <hr>
            <h3>nodemanager 状态</h3>
            <hr>
            <table class="table table-hover table-bordered">
                <thead>
                <tr>
                    <th>集群名称</th>
                    <th>rm编号</th>
                    <th>主机名</th>
                    <th>服务状态</th>
                </tr>
                </thead>
                <tbody>
                <tr th:each="rm : ${rmList}">
                    <td th:text="${rm.getClusterId()}"></td>
                    <td th:text="${rm.getRmId()}"></td>
                    <td th:text="${rm.getHostname()}"></td>
                    <td th:text="${rm.getServiceState()}"></td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>
</body>

</html>